package com.hqyj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hqyj.dao.DormDao;
import com.hqyj.pojo.Dorm;
import com.hqyj.pojo.PageData;

import com.hqyj.service.DormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DormServiceImpl implements DormService {
    @Autowired
    private DormDao dormDao ;

    @Override
    public List<Dorm> getAllDorm() {
        List<Dorm> dormList = dormDao.queryAll2();
        return dormList;
    }

    @Override
    public int insertDorm(Dorm dorm) {
        int result =dormDao.insertOne2(dorm);
        return result;
    }

    @Override
    public int deleteDorm(Dorm dorm) {
        int result=dormDao.deleteByDorm(dorm);

        return result;
    }

    @Override
    public int updateDorm(Dorm dorm) {
        int result = dormDao.updateOne(dorm);
        return result;
    }


}
